From 2f081add3ea0d1ea18629073c1d6964a093c9a5d Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 19 Jun 2007 15:09:59 +0100 Subject: [PATCH] x86: Re-introduce VIDEO_CURRENT_MODE into video.S video-mode-setting code, and make visible at the command line via 'vga=current'. Signed-off-by: Keir Fraser --- docs/src/user.tex | 1 + xen/arch/x86/boot/cmdline.S | 17 ++++++++++++++++- xen/arch/x86/boot/video.S | 2 ++ xen/arch/x86/boot/video.h | 9 +++++---- xen/drivers/video/vga.c | 3 +++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/docs/src/user.tex b/docs/src/user.tex index 541d7e3b0c..2ccbf8b87c 100644 --- a/docs/src/user.tex +++ b/docs/src/user.tex @@ -3178,6 +3178,7 @@ editing \path{grub.conf}. \begin{description} \item[ ask ] Display a vga menu allowing manual selection of video mode. + \item[ current ] Use existing vga mode without modification. \item[ text-$<$mode$>$ ] Select text-mode resolution, where mode is one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60. \item[ gfx-$<$mode$>$ ] Select VESA graphics mode diff --git a/xen/arch/x86/boot/cmdline.S b/xen/arch/x86/boot/cmdline.S index 34c183a268..9dcce5e155 100644 --- a/xen/arch/x86/boot/cmdline.S +++ b/xen/arch/x86/boot/cmdline.S @@ -297,7 +297,7 @@ cmdline_parse_early: call .Lstr_prefix add $8,%esp test %eax,%eax - jnz .Lcmdline_exit + jnz .Lparse_vga_current /* We have 'vga=mode-'. */ add $5,%ebx @@ -305,6 +305,19 @@ cmdline_parse_early: call .Latoi add $4,%esp mov %ax,bootsym_phys(boot_vid_mode) + jmp .Lcmdline_exit + +.Lparse_vga_current: + /* Check for 'vga=current'. */ + push %ebx + pushl $sym_phys(.Lvga_current) + call .Lstr_prefix + add $8,%esp + test %eax,%eax + jnz .Lcmdline_exit + + /* We have 'vga=current'. */ + movw $VIDEO_CURRENT_MODE,bootsym_phys(boot_vid_mode) .Lcmdline_exit: popa @@ -328,6 +341,8 @@ cmdline_parse_early: .asciz "gfx-" .Lvga_mode: .asciz "mode-" +.Lvga_current: + .asciz "current" .Lno_rm_opt: .asciz "no-real-mode" .Ledid_opt: diff --git a/xen/arch/x86/boot/video.S b/xen/arch/x86/boot/video.S index d8b3fab537..d62fa9e043 100644 --- a/xen/arch/x86/boot/video.S +++ b/xen/arch/x86/boot/video.S @@ -530,6 +530,7 @@ spec_inits: .word bootsym(set_8pixel) .word bootsym(set_80x43) .word bootsym(set_80x28) + .word bootsym(set_current) .word bootsym(set_80x30) .word bootsym(set_80x34) .word bootsym(set_80x60) @@ -575,6 +576,7 @@ set14: movw $0x1111, %ax # Use 9x14 font movb $0x01, %ah # Define cursor scan lines 11-12 movw $0x0b0c, %cx int $0x10 +set_current: stc ret diff --git a/xen/arch/x86/boot/video.h b/xen/arch/x86/boot/video.h index 08bc1e38ed..4026954196 100644 --- a/xen/arch/x86/boot/video.h +++ b/xen/arch/x86/boot/video.h @@ -16,10 +16,11 @@ #define VIDEO_80x50 0x0f01 #define VIDEO_80x43 0x0f02 #define VIDEO_80x28 0x0f03 -#define VIDEO_80x30 0x0f04 -#define VIDEO_80x34 0x0f05 -#define VIDEO_80x60 0x0f06 -#define VIDEO_LAST_SPECIAL 0x0f07 +#define VIDEO_CURRENT_MODE 0x0f04 +#define VIDEO_80x30 0x0f05 +#define VIDEO_80x34 0x0f06 +#define VIDEO_80x60 0x0f07 +#define VIDEO_LAST_SPECIAL 0x0f08 #define ASK_VGA 0xfffd #define VIDEO_VESA_BY_SIZE 0xffff diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c index 1f6c2c504a..7c9326e40c 100644 --- a/xen/drivers/video/vga.c +++ b/xen/drivers/video/vga.c @@ -33,6 +33,9 @@ static unsigned char *video; * 'vga=ask': * display a vga menu of available modes * + * 'vga=current': + * use the current vga mode without modification + * * 'vga=text-80x': * text mode, where is one of {25,28,30,34,43,50,60} * -- 2.30.2